<html>
    <head>
        <link rel="stylesheet" href="src/css/check_in.css">
    </head>

    <body>
        <header>
        <?php
        include_once "for_include/check_user.php";

        $username=$_GET['username'];
        $change_code=$_GET['change_code'];

        $sql_config=include "server_config/config.php";
        $dbobj = new mysqli($sql_config['db_host'],$sql_config['db_user'],$sql_config['db_pw'],$sql_config['db_name'],$sql_config['db_port']);
        if(!$dbobj->connect_error) echo"数据库连接成功！<br>";

        if(check_user($username))
        {
            die("账号已存在！不能重复创建！如果忘记密码，请联系服主！<br><a href=\"index.php\">点我回到上一页</a>");
        }
        else
        {
            $stmt=$dbobj->prepare("INSERT INTO mc_skin_con (username,changeCode) VALUES (?,?)");

            
            $stmt->bind_param("ss",$username,$change_code);
            
            if($stmt->execute())
            {
                echo "
                    用户名：{$username}  <br>
                    修改码：{$change_code} <br>
                    创建完毕。请在首页的第二个表登录。<br>
                ";
            }
            else
            {
                echo "创建失败！请重试多几次！<br>";
            }
        }
        




    ?>
        </header>
    </body>



    <br>
    <a href="index.php">点我回到上一页</a>


</html>